using System.Collections.Generic;

namespace UserManagement
{
    /// <summary>
    /// 用户服务接口：定义用户相关的业务方法
    /// </summary>
    public interface IUserService
    {
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="user">要注册的用户对象</param>
        /// <returns>注册成功返回true，失败返回false</returns>
        bool Register(User user);
        
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="password">密码</param>
        /// <returns>登录成功返回对应的User对象，失败返回null</returns>
        User Login(string username, string password);
        
        /// <summary>
        /// 获取所有用户信息
        /// </summary>
        /// <returns>用户列表</returns>
        List<User> GetAllUsers();
        
        /// <summary>
        /// 根据用户名查找用户
        /// </summary>
        /// <param name="username">用户名</param>
        /// <returns>找到的用户对象，未找到返回null</returns>
        User FindUserByUsername(string username);
        
        /// <summary>
        /// 根据ID删除用户
        /// </summary>
        /// <param name="id">用户ID</param>
        /// <returns>删除成功返回true，失败返回false</returns>
        bool DeleteUserById(long id);
        
        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="user">包含更新信息的用户对象</param>
        /// <returns>更新成功返回true，失败返回false</returns>
        bool UpdateUser(User user);
    }
}